package org.parademo.model;

/**
 * @author Ajit Skanda
 * @version 1.0
 */

public enum Category {
	Education,
	Sports,
	Environment,
	Politics,
	Defence,
	Economy,
	Philosophy,
	Internal;

	public static Category fromString (String categoryStr) {
		if(Category.Education.name().equalsIgnoreCase(categoryStr)) {
			return Category.Education;
		} else if(Category.Sports.name().equalsIgnoreCase(categoryStr)) {
			return Category.Sports;
		} else if(Category.Environment.name().equalsIgnoreCase(categoryStr)) {
			return Category.Environment;
		} else if(Category.Politics.name().equalsIgnoreCase(categoryStr)) {
			return Category.Politics;
		} else if(Category.Defence.name().equalsIgnoreCase(categoryStr)) {
			return Category.Defence;
		} else if(Category.Economy.name().equalsIgnoreCase(categoryStr)) {
			return Category.Economy;
		} else if(Category.Philosophy.name().equalsIgnoreCase(categoryStr)) {
			return Category.Philosophy;
		} else if(Category.Internal.name().equalsIgnoreCase(categoryStr)) {
			return Category.Internal;
		} else {
			return null;
		}
	}
}
